
<form id="form" action="{:url('card/index')}">
<input type="hidden" name="id" value="{$info.id}"/>
<input type="hidden" name="logo" value="{$info.logo}" id="logo" />
<table class="formtable">
    <tr><th>公司Logo</th><td><div class="img-review fn-cp">{if $info.logo}<img src="{$info.logo}">{/if}</div></td></tr>
    <tr><th>公司名称:</th><td><input class="input w350" datatype="*" type="text" name="title" value="{$info.title}" /></td></tr>
    <tr><th>公司电话:</th><td><input class="input w350" datatype="*" type="text" name="phone" value="{$info.phone}" /></td></tr>
    <tr><th>公司邮箱:</th><td><input class="input w350" datatype="*" type="text" name="email" value="{$info.email}" /></td></tr>
    <tr><th>公司地址:</th><td>
        <input class="input w350" datatype="*" type="text" name="address" value="{$info.address}" />
        <button type="button" class="button button-green lib"><i class="iconfont icon-address_icon"></i>读取经纬</button>
        <input readonly="true" autocomplete="off" class="input w100 readonly" datatype="*" type="text" name="longitude" value="{$info.longitude}" />
        <input readonly="true" autocomplete="off" class="input w100 readonly" datatype="*" type="text" name="latitude" value="{$info.latitude}" /> <br />
        <span class="gray"><i class="iconfont icon-address_icon"></i>地址请包含<span class="red">省市地区</span>完整地址,方便位置定位判断</span>
    </td></tr>
    <tr><th>公司简介:</th><td><textarea name="content" class="textarea ui-editor">{$info.content|dehtml}</textarea></td></tr>
    <tr>
        <th></th>
        <td>
            <input type="submit" value="确定" class="button button-blue submit" />
            <input type="reset" value="重置" class="button button-blank"/>
        </td>
    </tr>
</table>
</form>
<script type="text/javascript">
Do('base','layer','form','editor',function(){
    $('#form').isForm({'upload':'{:url("system/passport.common/upload")}'});
    $(".img-review").click(function(){
        openwin('{:url("system/passport.common/upload",["input" => "setPic"])}')
    });
    $(".lib").click(function () {
        var val = $("input[name='address']").val();
        if(val == "" || val == null || val == undefined){
            parent.layer.alert('公司地址必须填写');
        }else{
            openwin('{:url("bestbao/card/baidu")}?address='+val)
        }
    });
    //添加图片
    $("#img-win").click(function(){
        openwin('{:url("system/passport.common/upload")}')
    });
})
//添加图片
function setPic(show_src){
    $("#logo").val(show_src);
    $(".img-review").html('<img src="'+show_src+'">');  
}
//设置经纬度
function setPoint(point){
    $("input[name='longitude']").val(point.lng);
    $("input[name='latitude']").val(point.lat);
}
</script>